<?php

namespace app\api\controller;


use app\admin\model\user\UserLevel;
use app\common\controller\Api;


/**
 * 会员接口
 */
class Card extends Api
{
    //protected $noNeedLogin = ['info'];
    protected $noNeedRight = ['*'];


    //会员信息
    public function info()
    {
        $card = UserLevel::get(2);

        $this->success('',$card);
    }

    //创建会员卡
    public function create()
    {
        try {
            $card_model = new \app\admin\model\CardOrder();
            $param = input();
            $param['user_id'] = $this->auth->id;
            $res = $card_model->add($param);

        } catch (\Exception $e) {
            $this->error($e->getMessage());
        }
        $this->success('发布成功',$res);
    }
}